# @Version  : 1.0
# @Author   : wgq
# @File     : exercise01.py
# @Date     : 2025/5/31 21:53
s_history = {'小明','张三','李四','王五','Lily','Bob'}
s_politic = {'小明','小花','小红','二狗'}
s_english = {'小明','Lily','Bob','Davil','李四'}
s_total  = s_history | s_politic | s_english
print(f'选课学生总共人数:{len(s_total)}')
s_all = s_history & s_politic & s_english
print(f'选了三科的学生人数：{len(s_all)}')
print(len(s_all))
s_hisAndPol = s_history & s_politic
s_hisAndEng = s_history & s_english
s_polAndEng = s_politic & s_english
# only_his = len(s_history) - len(s_hisAndEng) - len(s_hisAndPol) + len(s_all)
# only_pol = len(s_politic) - len(s_hisAndPol) - len(s_polAndEng) + len(s_all)
# only_eng = len(s_english) - len(s_hisAndEng) - len(s_polAndEng) + len(s_all)
# print('只选了第一个学科的学生人数：',only_his)
# print('只选了一门学科的学生人数：',only_his + only_pol + only_eng)
print(f'只选择历史的人数：{len(s_history - s_politic - s_english)}')
print(f'只选政治的人数：{len(s_politic - s_history - s_english)}')
print(f'只选英语的人数：{len(s_english - s_history - s_politic)}')
